function reducer(prevState = 0, action) {
  switch (action.type) {
    case "increment":
      return prevState + action.payload;
    case "decrement":
      return prevState - action.payload;
    default:
      return prevState;
  }
}

export default reducer;
